﻿using System.Collections.Generic;
using NsbExtensions.Messages.Management.Monitoring;
using NsbExtensions.Server.Management.EndpointMonitor;

namespace NsbExtensions.Tests.Stubs
{
    public class TestStatusRepository : IEndpointStatusRepository
    {
        private readonly object _threadLock = new object();
        public List<EndpointStatusUpdateNotification> StatusList { get; set; }

        #region IEndpointStatusRepository Members

        public void AddStatus(EndpointStatusUpdateNotification status)
        {
            lock (_threadLock)
            {
                if (StatusList == null)
                    StatusList = new List<EndpointStatusUpdateNotification>();
                StatusList.Add(status);
            }
        }

        #endregion
    }
}